module.exports = app => {
  const mongoose = app.mongoose;
  const { ObjectId } = mongoose.Schema.Types;
  const Schema = mongoose.Schema;
  const RoleSchema = new Schema({
    userId: {
      type: ObjectId,
      required: true // 必填项
    },
    prompt: {
      type: String,
      required: true
    },
    url: {
      type: String,
      required: true
    },
    date: {
      type: Number,
      required: true
    },
    favrite: {
      type: Number,
      required: true
    }
  });
  return mongoose.model("Image", RoleSchema, "image");
};
